$.extend($.fn.validatebox.defaults.rules, {
	// 用户名
	username: {
		validator: function(value) {
			return /^[a-zA-Z][0-9A-Za-z_@@.]{4,30}$/i.test(value);
		}
	},
	// 密码
	password: {
		validator: function(value) {
			return (/^(?=.*\d)(?=.*[A-Za-z])(?=.*[.!@#$%^&*\(\)]).{9,22}$/.test(value));
		}
	},
	// 文件名
	filename: {
		validator: function (value) {
			return !/[\\\/\*\?\|:<>]/g.test(value);
		}
	},
	// 邮箱地址
	internetAddress: {
		validator: function (value) {
			return /^.*<?([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})>?$/.test(value);
		}
	},
	//数字小于
	lessThan: {
		validator: function(value, param) {
			var aaaaa = parseFloat(value.replace(/,/gi, ''));
			if ($(param[0])[0] instanceof HTMLElement) {
				var bbbbb = parseFloat($(param[0]).val());
				if (isNaN(bbbbb))
					return false;
				else
					return aaaaa < bbbbb;
			} else {
				return aaaaa < parseFloat(param[0]);
			}
		}
	},
	//数字小于等于
	lessThanEqual: {
		validator: function(value, param) {
			var aaaaa = parseFloat(value.replace(/,/gi, ''));
			if ($(param[0])[0] instanceof HTMLElement) {
				var bbbbb = parseFloat($(param[0]).val());
				if (isNaN(bbbbb))
					return false;
				else
					return aaaaa <= bbbbb;
			} else {
				return aaaaa <= parseFloat(param[0]);
			}
		}
	},
	//数字大于
	greaterThan: {
		validator: function(value, param) {
			var aaaaa = parseFloat(value.replace(/,/gi, ''));
			if ($(param[0])[0] instanceof HTMLElement) {
				var bbbbb = parseFloat($(param[0]).val());
				if (isNaN(bbbbb))
					return true;
				else
					return aaaaa > bbbbb;
			} else {
				return aaaaa > parseFloat(param[0]);
			}
		}
	},
	//数字大于等于
	greaterThanEqual: {
		validator: function(value, param) {
			var aaaaa = parseFloat(value.replace(/,/gi, ''));
			if ($(param[0])[0] instanceof HTMLElement) {
				var bbbbb = parseFloat($(param[0]).val());
				if (isNaN(bbbbb))
					return true;
				else
					return aaaaa >= bbbbb;
			} else {
				return aaaaa >= parseFloat(param[0]);
			}
		}
	},
	//等于
	equals: {
		validator: function (value, param) {
			if ($(param[0])[0] instanceof HTMLElement) {
				return $(param[0]).val() == value;
			} else {
				return param[0] == value;
			}
		}
	},
	//有效范围数字
	between: {
		validator: function(value, param) {
			return parseFloat(value.replace(/,/gi, '')) >= parseFloat(param[0]) && parseFloat(value.replace(/,/gi, '')) <= parseFloat(param[1]);
		}
	},
	//最小长度
	minLength: {
		validator: function(value, param) {
			return value.length >= param[0];
		}
	},
	//最大长度
	maxLength: {
		validator: function(value, param) {
			return value.length <= param[0];
		}
	},
	afterDate: {
		validator: function(value, param) {
			var bbbbb = param[0];
			if ($(param[0])[0] instanceof HTMLElement) {
				bbbbb = $(param[0]).val();
			}
			if (bbbbb) {
				var aaaaa = value.split("-");
				var d1 = new Date(aaaaa[0], aaaaa[1]-1, aaaaa[2], 0, 0, 0);
				aaaaa = bbbbb.split("-");
				var d2 = new Date(aaaaa[0], aaaaa[1]-1, aaaaa[2], 0, 0, 0);
				return d1 >= d2;
			}
			return true;
		}
	},
	beforeDate: {
		validator: function(value, param) {
			var bbbbb = param[0];
			if ($(param[0])[0] instanceof HTMLElement) {
				bbbbb = $(param[0]).val();
			}
			if (bbbbb) {
				var aaaaa = value.split("-");
				var d1 = new Date(aaaaa[0], aaaaa[1]-1, aaaaa[2], 0, 0, 0);
				aaaaa = bbbbb.split("-");
				var d2 = new Date(aaaaa[0], aaaaa[1]-1, aaaaa[2], 0, 0, 0);
				return d1 < d2;
			}
			return true;
		}
	}
});